import { createRouter, createWebHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    redirect:'/business/list'
  },
  {
      path: '/business/list',
      component:()=>import('@/views/business/list.vue')
    },
  {
    path: '/business/detail',
    component:()=>import('@/views/business/detail/index'),
    // 子路由不加/可连接父组件的路由
    redirect: 'detail/foods',
    children:[
  {
    path:'foods',
    component:()=>import('@/views/business/detail/foods')
  },
      {
        path:'info',
        component:()=>import('@/views/business/detail/info')
      },

    ]
  },
  {
    path: '/car/list',
    component:()=>import('@/views/car/list')
  },
  {
    path: '/user/my',
    component:()=>import('@/views/user/my')
  },
  {
    path: '/user/login',
    component:()=>import('@/views/user/login')
  },
  {
    path: '/order/confirm',
    component:()=>import('@/views/order/confirm')
  },
  {
    path: '/address/addressAdd',
    component:()=>import('@/views/business/address/addressAdd')
  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
